/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

function ValInputAkunActivation(frm, id){ 
    var illegalChars=new Array();
    info=new Array();
    var tErr='';
    var tReq= $("#"+id).attr("rel");
    illegalChars['fPassword']=/^[a-zA-Z0-9\ \.\,\@\-\_\/\#\!\+\=]{5,32}$/;
    illegalChars['fRePassword']=/^[a-zA-Z0-9\ \.\,\@\-\_\/\#\!\+\=]{5,32}$/;
    info['fPassword']="<br>Input yang diperbolehkan: [alfabet] [spasi] ' . ,";
    info['fRePassword']="<br>Input yang diperbolehkan: [alfabet] [spasi] ' . ,";
    t_value= frm.value;
    tErr=Validating(frm, id, illegalChars, info, t_value, tReq, false);
    return tErr;
}

function ValSubmitAkunActivation(){
    var frm= document.formAkunActivation;
    var tErr='';
    
    tErr+= ValInputAkunActivation(frm.fPassword, 'fPassword');
    tErr+= ValInputAkunActivation(frm.fRePassword, 'fRePassword');
    if(tErr==''){
        //PERIKSA IS password dan RePassword identik?
        if(frm.fPassword.value === frm.fRePassword.value){
            return true;
        }
        else {
            $("#ErrorHandler-Container").html("Password tidak sama. <b>Password</b> dan <b>Ketik Ulang Password</b> harus sama. Silahkan langi lagi!");
            $("#ErrorHandler-Container").fadeIn("normal");
            $("#fRePassword").addClass("error-form");
            $("#fRePassword").focus();
            return false;
        }
    }
    else {
        $("#ErrorHandler-Container").html("Password tidak valid. Lihat ketentuan penggunaan password di bawah!");
        $("#ErrorHandler-Container").fadeIn("normal");
        return false;
    }
    
} 
